/*
 * This file is part of TradeHelper library.
 *
 * TradeHelper library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TradeHelper library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TradeHelper library.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.rag.assistants;

import com.alee.laf.WebLookAndFeel;
import com.rag.core.Item;
import com.rag.managers.BaseManager;
import com.rag.managers.RagManager;

/**
 * User: mgarin Date: 09.06.12 Time: 16:19
 */

public class FindInBase
{
    /**
     * Метод для нахождения итема в базе
     */

    public static void main ( String[] args )
    {
        String toFind = "larva".toLowerCase ();

        WebLookAndFeel.install ();
        BaseManager.initialize ();
        RagManager.initialize ();

        for ( Item item : RagManager.getKnownItems ().getValues () )
        {
            if ( item.getTitle ().toLowerCase ().contains ( toFind ) ||
                    item.getSynonym () != null &&
                            item.getSynonym ().toLowerCase ().contains ( toFind ) )
            {
                System.out.println ( item.getText () );
                System.out.println ( item.getSynonym () );
                System.out.println ( item.getId () );
                System.out.println ( item.getDescription () );
                System.out.println ( item.getScript () );
                System.out.println ();
            }
        }
        System.exit ( 0 );
    }
}